package com.chenjiagou.controller;

import com.chenjiagou.service.NotificationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/admin/notification")
public class AdminNotificationController {

    @Autowired
    private NotificationService notificationService;

    // 发布通知给指定航班的所有用户
    @PostMapping("/publish")
    public void publishNotification(@RequestParam("flightId") int flightId,
                                    @RequestParam("title") String title,
                                    @RequestParam("content") String content) {
        notificationService.publishNotification(flightId, title, content);
    }
}
